package com.huike.review.controller;

import com.huike.review.pojo.Review;
import com.huike.review.service.ReviewService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/review")
public class ReviewController {

    @Autowired
    private ReviewService reviewService;

    /*
    * 新增
    * */
    @PostMapping
    public void add(@RequestBody Review review){

        reviewService.add(review);

    }

    /*
    * 删除
    * */
    /*
     * 删除
     * */
    @DeleteMapping
    public void delete(int id){

        reviewService.deleteById(id);

    }

    /*
    * 修改
    * */
    @PutMapping
    public void update(@RequestBody Review review){

        reviewService.update(review);

    }


    /*
    * 查询
    * */
    @GetMapping
    public void selectById(int id){
        reviewService.selectById(id);

    }

}
